package website.lhc.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import website.lhc.commo.util.JsonUtil;
import website.lhc.dao1.UserMapper;
import website.lhc.dao2.AddressMapper;
import website.lhc.model.Address;
import website.lhc.model.User;
import website.lhc.service.UserService;

import java.util.List;

/**
 * @ProjectName: springboot
 * @Package: website.lhc.service.impl
 * @ClassName: UserServiceImpl
 * @Author: lhc
 * @Description: TODO
 * @Date: 2020/7/14 下午 11:45
 */
@Service
public class UserServiceImpl implements UserService {

    private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private AddressMapper addressMapper;

    @Override
    public void listUser() {
        List<User> userList = userMapper.selectAll();
        List<Address> addresses = addressMapper.selectAll();
        log.info("userList:{};addresses:{}", JsonUtil.toJsonString(userList), JsonUtil.toJsonString(addresses));
    }
}
